<?xml version="1.0" encoding="UTF-8"?>
<ui:composition template="template.xhtml"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:t="http://myfaces.apache.org/tomahawk"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:s="http://myfaces.apache.org/sandbox"
                xmlns:jwork="http://irian.at/jsfatwork"
        >
    <ui:define name="content">
        <h:form id="cform">
            <h3>Tasks</h3>

            <h:commandLink value="Add new Task multiple steps" action="#{taskBean.addNewMultipleSteps}" />
            <jwork:addNewGrid bean="#{taskBean}" entity="#{taskBean.entity}" entityName="task" idSave="save" >
                <ui:define name="inputFields" >
                    <jwork:taskEditor />
                </ui:define>
            </jwork:addNewGrid>

            <br/>

            <jwork:dataList partialTriggers="save" editProperty="name" contentProperty="description" bean="#{taskBean}" editMultipleSteps="true" >
                <ui:define name="inputFields" >
                    <jwork:taskEditor />
                </ui:define>

                <ui:define name="additionalInfo" >
                    <h:panelGrid columns="2" styleClass="border:none">
                        <h:outputText value="status:" style="font-weight:bold"/>
                        <h:outputText value="#{entity.status}" converter="TaskStatusEnumConverter"/>

                        <h:outputText value="project:" style="font-weight:bold"/>
                        <h:outputText value="#{entity.project.name}" />

                        <h:outputText value="task for:" style="font-weight:bold" />
                        <t:dataList var="resource" value="#{entity.resources}" layout="simple" rowCountVar="rowCount" rowIndexVar="rowIndex">
                            <h:outputText value="#{resource.name}" />
                            <h:outputText value=", " rendered="#{rowIndex + 1 lt rowCount}" />
                        </t:dataList>
                    </h:panelGrid>
                </ui:define>
            </jwork:dataList>

        </h:form>
    </ui:define>
</ui:composition>
